

<template>
  <div>
    <basic-container>
      <avue-crud :option="tableOption" :data="tableData" :table-loading="tableLoading" :page="page" ref="crud" @size-change="sizeChange" @current-change="currentChange" @row-click="handleClick">>

        <template slot="menuLeft">
        </template>
        <template slot-scope="scope" slot="menu" style="width:100px">
          <el-button type="primary" @click="handleSkuList(scope.row.id)" size="small">编辑</el-button>
        </template>
      </avue-crud>
    </basic-container>
  </div>
</template>

<script>
/* eslint-disable */
import { mapGetters } from "vuex";
import crudMixin from '@/mixins/crud'
import options from "./options.js";
import { isNull, arr2pojo, obj2pojo, validateResponse } from "@/util/util";
import { successMsg, errorMsg } from "@/util/message"
import { field, reField } from "./field";

export default {
  name: "role",
  mixins: [crudMixin],
  components: {
  },
  data() {
    return Object.assign({}, options, {
    })
  },
  created() {
    //初始化数据格式
    this.handleList();
  },
  watch: {},
  mounted() { },
  computed: {
  },
  props: [],
  methods: {

    handleList(form = {}) {
      this.tableLoading = true;
      let param = Object.assign({}, form, {
        perPage: this.page.pageSize,
        page: this.page.currentPage
      });
      var vm = this
      this.tableData = [];
      this.page.total = 0;
      this.tableLoading = false;

      // this.$store
      //   .dispatch("GetLibrary", param)
      //   .then(
      //     res => {
      //       console.log(res)
      //       this.tableLoading = false;
      //       if (res.data.status == 1) {
      //         let _data = res.data.result.data || []
      //         let _meta = res.data.result.meta || []

      //         this.tableData = _data;
      //         this.page.total = _meta.total;
      //       }
      //     }, error => {
      //       this.tableLoading = false;
      //     })
    },
  }
};
</script>
